<template>
  <header>
    <span class="iconfont icon-menu" v-if="hasMenu"></span>
    <!-- {{ title }} -->
    <slot></slot>
    <span class="iconfont icon-huitui" v-if="hasBack"></span>
  </header>
</template>

<script>
export default {
  name: "MyHeader",
  props: {
    title: String,
    hasBack: Boolean,
    hasMenu: Boolean,
  },
  data() {
    return {};
  },
};
</script>

<style lang="less" scoped>
@import "../../assets/css/commons.less";

header {
  width: 100%;
  height: 50px;
  background-color: @theme-color;
  .center();
  color: #fff;
  font-size: @fontSize_18;
  position: relative;

  .iconfont {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: @fontSize_20;
  }

  .icon-menu {
    right: 15px;
  }

  .icon-huitui {
    left: 15px;
  }
}
</style>
